package com.md.lesson;

import java.util.Random;
import java.util.Scanner;

public class Text {
	public static void main(String[] args) {
	//定义一个方法，
	//实现的功能是：随机生成银行卡后7位数，返回的数据格式如：0586 756
		System.out.println(getrandomNum());
	}
	public static String getrandomNum() {
		Random ran = new Random();
		String num1 ="0000"+ran.nextInt(10000);
		String num2 = "000"+ran.nextInt(1000);
		String result = num1.substring(num1.length()-4)+" "
						+num2.substring(num2.length()-3);
		return result;
	}
}
